
// 2. test scalar
// build: g++ -I/usr/include/eigen3 2.matrix_scalar.cpp
#include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
    // Matrix2d 是 2*2 的，Matrix3d 是 3*3 的
    Eigen::Matrix2d a;
    a << 1, 2,
        3, 4;
    Eigen::Vector3d v(1, 2, 3);
    std::cout << "a * 2.5 =\n"
              << a * 2.5 << std::endl;
    std::cout << "0.1 * v =\n"
              << 0.1 * v << std::endl;
    std::cout << "Doing v *= 2;" << std::endl;
    v *= 2;
    std::cout << "Now v =\n"
              << v << std::endl;

    // Dynamic size
    Eigen::Matrix3Xd d;
    d.resize(Eigen::NoChange_t::NoChange,2);
    d << 1, 2,
        3, 4,
        5, 6;
    std::cout << "Dynamic size\n d * 2.5 =\n"
              << d * 2.5 << std::endl;

    // https://eigen.tuxfamily.org/dox/group__QuickRefPage.html
    // Four "resize" methods 
    // matrix.resize(nb_rows, nb_cols);
    // matrix.resize(Eigen::NoChange, nb_cols);
    // matrix.resize(nb_rows, Eigen::NoChange);
    // matrix.resizeLike(other_matrix);

             
}
